package com.example.demo.service;

import com.example.demo.dto.RoleDto;
import com.example.demo.dto.RoleSmallDto;
import com.example.demo.dto.UserDto;
import com.example.demo.entity.Role;
import com.example.demo.entity.User;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;
import java.util.List;

public interface RoleService {

    /**
     * 获取用户权限信息
     * @param user 用户信息
     * @return 权限信息
     */
    Collection<GrantedAuthority> mapToGrantedAuthorities(UserDto user);

    RoleDto findById(long id);

    List<RoleSmallDto> findByUsersId(Long id);

    Integer findByRoleId(Long roleId);
}
